<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<!DOCTYPE html>
<html>
<head>
    <title>注册页面</title>
    <style>
        body {
            font-family: 'Arial', sans-serif;
            background-color: #f2f2f2;
            margin: 0;
            padding: 0;
            display: flex;
            justify-content: center;
            align-items: center;
            min-height: 100vh;
        }

        .register-container {
            width: 400px;
            padding: 35px 30px;
            background-color: #ffffff;
            border-radius: 10px;
            box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
            box-sizing: border-box;
        }

        .register-title {
            text-align: center;
            margin-bottom: 25px;
            color: #333333;
            font-size: 24px;
            font-weight: 600;
        }

        .register-table {
            width: 100%;
            table-layout: fixed;
            border-collapse: separate;
            border-spacing: 0 15px;
        }

        .register-table td {
            vertical-align: middle;
        }

        .register-table td:first-child {
            width: 80px;
            color: #555555;
            font-weight: 500;
            padding-right: 15px;
        }

        .register-table td input[type="text"],
        .register-table td input[type="password"] {
            width: 100%;
            padding: 12px 15px;
            border: 1px solid #dddddd;
            border-radius: 6px;
            font-size: 14px;
            transition: border-color 0.3s;
            box-sizing: border-box;
        }

        .register-table td input[type="text"]:focus,
        .register-table td input[type="password"]:focus {
            border-color: #2196F3;
            outline: none;
        }

        .radio-group {
            display: flex;
            gap: 15px;
            margin-top: 8px;
        }

        .radio-group label {
            display: flex;
            align-items: center;
            gap: 5px;
            cursor: pointer;
            font-size: 14px;
            color: #555555;
        }

        .radio-group input[type="radio"] {
            margin: 0;
        }

        .btn-register {
            width: 100%;
            padding: 12px;
            background-color: #2196F3;
            border: none;
            color: white;
            font-size: 16px;
            font-weight: 500;
            border-radius: 6px;
            cursor: pointer;
            transition: background-color 0.3s;
            margin-top: 10px;
        }

        .btn-register:hover {
            background-color: #1976D2;
        }

        .login-link {
            margin-top: 20px;
            text-align: center;
            font-size: 14px;
            color: #666666;
        }

        .login-link a {
            text-decoration: none;
            color: #4CAF50;
            font-weight: 500;
            transition: color 0.3s;
        }

        .login-link a:hover {
            color: #3d8b40;
            text-decoration: underline;
        }

        /* 响应式设计 */
        @media (max-width: 480px) {
            .register-container {
                width: 90%;
                padding: 25px 20px;
            }

            .register-table td:first-child {
                width: 70px;
                padding-right: 10px;
            }
        }
    </style>
</head>
<body>

<div class="register-container">
    <div class="register-title">用户注册</div>
    <form action="regservlet" method="post">
        <table class="register-table">
            <tr>
                <td>用户名</td>
                <td><input type="text" id="txtname" name="txtname" required></td>
            </tr>
            <tr>
                <td>密码</td>
                <td><input type="password" id="txtpwd" name="txtpwd" required></td>
            </tr>
            <tr>
                <td>性别</td>
                <td>
                    <div class="radio-group">
                        <label><input type="radio" name="sex" value="1" checked>男</label>
                        <label><input type="radio" name="sex" value="0">女</label>
                    </div>
                </td>
            </tr>
            <tr>
                <td>邮箱</td>
                <td><input type="text" id="txtemail" name="txtemail" required></td>
            </tr>
            <tr>
                <td>身份</td>
                <td>
                    <div class="radio-group">
                        <label><input type="radio" name="role" value="user" checked>普通用户</label>
                        <label><input type="radio" name="role" value="admin">管理员</label>
                    </div>
                </td>
            </tr>
            <tr>
                <td colspan="2">
                    <input type="submit" value="注册" class="btn-register">
                </td>
            </tr>
        </table>
        <div class="login-link">
            <p>已有账号？<a href="index.jsp">立即登录</a></p>
        </div>
    </form>
</div>

</body>
</html>
